<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="<?php echo __PUBLIC__;?>/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo __PUBLIC__;?>/js/jquery.js"></script>
<script language="javascript">
$(function(){	
	//导航切换
	$(".imglist li").click(function(){
		$(".imglist li.selected").removeClass("selected")
		$(this).addClass("selected");
	})	
})	
</script>
<script type="text/javascript">
$(document).ready(function(){
  $(".click").click(function(){
  $(".tip").fadeIn(200);
  });
  
  $(".tiptop a").click(function(){
  $(".tip").fadeOut(200);
});

  $(".sure").click(function(){
  $(".tip").fadeOut(100);
});

  $(".cancel").click(function(){
  $(".tip").fadeOut(100);
});

});
</script>
<style type="text/css">
    .artImg{
        width: 80px;
        height: 60px;
    }
</style>
</head>


<body>

	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    <li><a href="#">图片列表</a></li>
    </ul>
    </div>
    
    <div class="rightinfo">
    
    <div class="tools">
    
    	<ul class="toolbar">
        <li><a href="/Admin/index.php?c=Article&f=art_add"><span><img src="<?php echo __PUBLIC__;?>/images/t01.png" /></span>添加</a></li>
        <!-- 想弹出确定框就加 class="click" -->
        <!-- <li class="click"><span><img src="<?php echo __PUBLIC__;?>/images/t02.png" /></span>修改</li> -->
        <li class='click'><span><img src="<?php echo __PUBLIC__;?>/images/t03.png" /></span>全部删除选中</li>
        <li><span><img src="<?php echo __PUBLIC__;?>/images/t04.png" /></span>统计</li>
        </ul>
        
        
        <ul class="toolbar1">
        <li><span><img src="<?php echo __PUBLIC__;?>/images/t05.png" /></span>设置</li>
        </ul>
    
    </div>
    
    <form action="/Admin/index.php?c=Article&f=art_delete" method="post">
        <table class="imgtable">
        
        <thead>
        <tr>
        <th><input type="checkbox" name="checkbox[]">&nbsp;全选</th>
        <th width="100px;">缩略图</th>
        <th>标题</th>
        <th>栏目</th>
        <th>权限</th>
        <th>发布人</th>
        <th>是否推荐</th>
        <th>点击</th>
        <th>操作</th>
        </tr>
        </thead>
        
        <tbody>
        <!-- $i：分页计数 -->
        <?php 
            $i = 1;
            foreach($result as $row) {
                if($i>=$pageS && $i<=$pageE){
                    $judge = ($row['recommend']==1) ? "<a href='/Admin/index.php?c=Article&f=art_recommend&id=".$row['id']."&type=1' style='color: green'>已推荐</a>" : "<i><a href='/Admin/index.php?c=Article&f=art_recommend&id=".$row['id']."&type=0' style='color: red'>未推荐</a></i>";
                    echo "
                        <tr>
                        <td><input type='checkbox' name='checkbox[]' value='".$row['id']."'></td>
                        <td class='imgtd'><img src='".__IMAGE__."/".$row['photourl']."/".$row['photoname']."' class='artImg' /></td>
                        <td><a href='#'>".$row['title']."</a><p>发布时间：".$row['time']."</p></td>
                        <td>".$row['classify']['title']."<p>ID: ".$row['id']."</p></td>
                        <td>开放浏览</td>
                        <td>zxy</td>
                        <td>".$judge."</td>
                        <td>".$row['browse']."</td>
                        <td>
                        <ul class='toolbar'>
                                <a href='/Admin/index.php?c=Article&f=art_update&id=".$row['id']."'><li><span><img src='".__PUBLIC__."/images/t02.png' /></span>修改</li></a>
        
                            <a href='/Admin/index.php?c=Article&f=art_delete&id=".$row['id']."'><li><span><img src='".__PUBLIC__."/images/t03.png' /></span>删除</li></a>
                        </ul>
                        </td>
                        </tr>   
                    ";
                    $i++;     
                }else{
                    $i++;
                }
            }   
        ?>
        
        
       
        
        </tbody>
        
        </table>
        
        
        
        
        
       
        <div class="pagin">
        	<div class="message">共<i class="blue"><?php echo $num_rows;?></i>条记录，当前显示第&nbsp;<i class="blue"><?php echo $page;?>&nbsp;</i>页</div>
            <ul class="paginList">
            <?php
                if($page!=1){
                    echo "
                        <li class='paginItem'><a href='/Admin/index.php?c=Article&f=source&pid=".($page-1)."'><span class='pagepre'></span></a></li>
                    ";
                }
            ?>
            
            <li class="paginItem current"><a href="/Admin/index.php?c=Article&f=source&pid=1">1</a></li>
            <?php 
                if($pageNum>5){
                    for($i=1;$i<5;$i++){
                        echo "
                            <li class='paginItem'><a href='/Admin/index.php?c=Article&f=source&pid=".($i+1)."'>".($i+1)."</a></li>
                        ";
                    }

                    echo "
                        <li class='paginItem more'><a href='javascript:;'>...</a></li>
                        <li class='paginItem'><a href='javascript:;'>10</a></li>
                    ";
                }else{
                    for($i=1;$i<$pageNum;$i++){
                        echo "
                            <li class='paginItem'><a href='/Admin/index.php?c=Article&f=source&pid=".($i+1)."'>".($i+1)."</a></li>
                        ";
                    }
                }
                
            ?>
           
            <?php 
                if($page==$pageNum){}else{
                    echo "
                       <li class='paginItem'><a href='/Admin/index.php?c=Article&f=source&pid=".($page+1)."'><span class='pagenxt'></span></a></li> 
                    ";
                }
            ?>
            
            </ul>
        </div>
        
        
        <div class="tip">
        	<div class="tiptop"><span>提示信息</span><a></a></div>
            
          <div class="tipinfo">
            <span><img src="<?php echo __PUBLIC__;?>/images/ticon.png" /></span>
            <div class="tipright">
            <p>是否确认对信息的修改 ？</p>
            <cite>如果是请点击确定按钮 ，否则请点取消。</cite>
            </div>
            </div>
            
            <div class="tipbtn">
            <input name="submit" type="submit"  class="sure" value="确定" />&nbsp;
            <input name="" type="button"  class="cancel" value="取消" />
            </div>
        
        </div>
    
    
    
        </div>
    
        <!-- 不知为何,怀疑重复提示框代码 -->
        <div class="tip">
        	<div class="tiptop"><span>提示信息</span><a></a></div>
            
          <div class="tipinfo">
            <span><img src="<?php echo __PUBLIC__;?>/images/ticon.png" /></span>
            <div class="tipright">
            <p>是否确认多项删除 ？</p>
            <cite>如果是请点击确定按钮 ，否则请点取消。</cite>
            </div>
            </div>
            
            <div class="tipbtn">
            <input name="submit" type="submit"  class="sure" value="确定" />&nbsp;
            <input name="" type="button"  class="cancel" value="取消" />
            </div>
        
        </div>
    </form>
    
<script type="text/javascript">
	$('.imgtable tbody tr:odd').addClass('odd');
	</script>
    
</body>

</html>
